home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 May / may_2001.iso / intercd / root / Multimedia / ^DivX_Article / virtualdub / VirtualDub-source-1_4d / InputFile.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-20  |  3.0 KB  |  114 lines

  1. //    VirtualDub - Video processing and capture application
  2. //    Copyright (C) 1998-2001 Avery Lee
  3. //
  4. //    This program is free software; you can redistribute it and/or modify
  5. //    it under the terms of the GNU General Public License as published by
  6. //    the Free Software Foundation; either version 2 of the License, or
  7. //    (at your option) any later version.
  8. //
  9. //    This program is distributed in the hope that it will be useful,
  10. //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. //    GNU General Public License for more details.
  13. //
  14. //    You should have received a copy of the GNU General Public License
  15. //    along with this program; if not, write to the Free Software
  16. //    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. #ifndef f_INPUTFILE_H
  19. #define f_INPUTFILE_H
  20.  
  21. #include <windows.h>
  22. #include <vfw.h>
  23.  
  24. #include "List.h"
  25.  
  26. class AudioSource;
  27. class VideoSource;
  28. class AVIStripeSystem;
  29. class IAVIReadHandler;
  30. class IAVIReadStream;
  31.  
  32.  
  33. class InputFileOptions {
  34. public:
  35.     virtual ~InputFileOptions()=0;
  36.     virtual bool read(const char *buf)=0;
  37.     virtual int write(char *buf, int buflen)=0;
  38. };
  39.  
  40. class InputFilenameNode : public ListNode2<InputFilenameNode> {
  41. public:
  42.     const char *name;
  43.  
  44.     InputFilenameNode(const char *_n);
  45.     ~InputFilenameNode();
  46. };
  47.  
  48. class InputFile {
  49. public:
  50.     AudioSource *audioSrc;
  51.     VideoSource *videoSrc;
  52.     List2<InputFilenameNode> listFiles;
  53.  
  54.     virtual ~InputFile();
  55.     virtual void Init(char *szFile) = 0;
  56.     virtual bool Append(const char *szFile);
  57.  
  58.     virtual void setOptions(InputFileOptions *);
  59.     virtual void setAutomated(bool);
  60.     virtual InputFileOptions *promptForOptions(HWND);
  61.     virtual InputFileOptions *createOptions(const char *buf);
  62.     virtual void InfoDialog(HWND hwndParent);
  63.  
  64.     virtual bool isOptimizedForRealtime();
  65.     virtual bool isStreaming();
  66.  
  67. protected:
  68.     void AddFilename(const char *lpszFile);
  69. };
  70.  
  71. class InputFileAVI : public InputFile {
  72. private:
  73.     IAVIReadHandler *pAVIFile;
  74.     IAVIReadStream *pAVIStreamAudio, *pAVIStreamVideo;
  75.  
  76.     AVIStripeSystem *stripesys;
  77.     IAVIReadHandler **stripe_files;
  78.     int stripe_count;
  79.     bool isASF;
  80.     bool fAutomated;
  81.  
  82.     bool fCompatibilityMode, fRedoKeyFlags, fInternalMJPEG, fDisableFastIO, fAcceptPartial, fAutoscanSegments;
  83.     int iMJPEGMode;
  84.     FOURCC fccForceVideo;
  85.     FOURCC fccForceVideoHandler;
  86.     long lForceAudioHz;
  87.  
  88.     static char szME[];
  89.  
  90.     static void _InfoDlgThread(void *pvInfo);
  91.     static BOOL APIENTRY _InfoDlgProc( HWND hDlg, UINT message, UINT wParam, LONG lParam);
  92. public:
  93.     InputFileAVI(bool isASF);
  94.     ~InputFileAVI();
  95.  
  96.     void Init(char *szFile);
  97.     void InitStriped(char *szFile);
  98.     bool Append(const char *szFile);
  99.  
  100.     bool isOptimizedForRealtime();
  101.     bool isStreaming();
  102.  
  103.     void setOptions(InputFileOptions *_ifo);
  104.     InputFileOptions *createOptions(const char *buf);
  105.     InputFileOptions *promptForOptions(HWND hwnd);
  106.     void EnableSegmentAutoscan();
  107.     void ForceCompatibility();
  108.    void setAutomated(bool fAuto);
  109.  
  110.     void InfoDialog(HWND hwndParent);
  111. };
  112.  
  113. #endif
  114.